package com.spsy.pay.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Builder;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.spsy.common.core.annotation.Excel;
import com.spsy.common.core.web.domain.BaseEntity;

/**
 * 支付管理对象 t_payment_order
 * 
 * @author ruoyi
 * @date 2025-09-16
 */
@Builder
@Data
public class TPaymentOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    private Long id;

    /** 系统支付的流水号 */
    @Excel(name = "系统支付的流水号")
    private String paymentMark;

    /** 订单ID */
    @Excel(name = "订单ID")
    private Long orderId;

    /** 支付用户ID */
    @Excel(name = "支付用户ID")
    private Long userId;

    /** 支付方式：1-微信  2-支付宝 */
    @Excel(name = "支付方式：1-微信  2-支付宝")
    private String payMay;

    /** 商户ID */
    @Excel(name = "商户ID")
    private Long merchantId;

    /** 商户名称 */
    @Excel(name = "商户名称")
    private String meichantName;

    /** 商户自己的订单号 */
    @Excel(name = "商户自己的订单号")
    private String merchantOrderNo;

    /** 订单总金额 */
    @Excel(name = "订单总金额")
    private BigDecimal totalAmount;

    /** 优惠金额 */
    @Excel(name = "优惠金额")
    private BigDecimal discountAmount;

    /** 实际支付金额 = 总金额-优惠金额 */
    @Excel(name = "实际支付金额 = 总金额-优惠金额")
    private BigDecimal payAmount;

    /** 订单状态：0-待支付 1-支付中 2-支付成功 3-支付失败 4-已关闭 5-已退款 */
    @Excel(name = "订单状态：0-待支付 1-支付中 2-支付成功 3-支付失败 4-已关闭 5-已退款")
    private Long orderStatus;

    /** 订单过期时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "订单过期时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date expireTime;

    /** 支付成功实践 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "支付成功实践", width = 30, dateFormat = "yyyy-MM-dd")
    private Date payTime;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public void setPaymentMark(String paymentMark) 
    {
        this.paymentMark = paymentMark;
    }

    public String getPaymentMark() 
    {
        return paymentMark;
    }

    public void setOrderId(Long orderId) 
    {
        this.orderId = orderId;
    }

    public Long getOrderId() 
    {
        return orderId;
    }

    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }

    public void setPayMay(String payMay) 
    {
        this.payMay = payMay;
    }

    public String getPayMay() 
    {
        return payMay;
    }

    public void setMerchantId(Long merchantId) 
    {
        this.merchantId = merchantId;
    }

    public Long getMerchantId() 
    {
        return merchantId;
    }

    public void setMeichantName(String meichantName) 
    {
        this.meichantName = meichantName;
    }

    public String getMeichantName() 
    {
        return meichantName;
    }

    public void setMerchantOrderNo(String merchantOrderNo) 
    {
        this.merchantOrderNo = merchantOrderNo;
    }

    public String getMerchantOrderNo() 
    {
        return merchantOrderNo;
    }

    public void setTotalAmount(BigDecimal totalAmount) 
    {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getTotalAmount() 
    {
        return totalAmount;
    }

    public void setDiscountAmount(BigDecimal discountAmount) 
    {
        this.discountAmount = discountAmount;
    }

    public BigDecimal getDiscountAmount() 
    {
        return discountAmount;
    }

    public void setPayAmount(BigDecimal payAmount) 
    {
        this.payAmount = payAmount;
    }

    public BigDecimal getPayAmount() 
    {
        return payAmount;
    }

    public void setOrderStatus(Long orderStatus) 
    {
        this.orderStatus = orderStatus;
    }

    public Long getOrderStatus() 
    {
        return orderStatus;
    }

    public void setExpireTime(Date expireTime) 
    {
        this.expireTime = expireTime;
    }

    public Date getExpireTime() 
    {
        return expireTime;
    }

    public void setPayTime(Date payTime) 
    {
        this.payTime = payTime;
    }

    public Date getPayTime() 
    {
        return payTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("paymentMark", getPaymentMark())
            .append("orderId", getOrderId())
            .append("userId", getUserId())
            .append("payMay", getPayMay())
            .append("merchantId", getMerchantId())
            .append("meichantName", getMeichantName())
            .append("merchantOrderNo", getMerchantOrderNo())
            .append("totalAmount", getTotalAmount())
            .append("discountAmount", getDiscountAmount())
            .append("payAmount", getPayAmount())
            .append("orderStatus", getOrderStatus())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("expireTime", getExpireTime())
            .append("payTime", getPayTime())
            .toString();
    }
}
